<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!doctype html>
<html lang="en" class="no-js">
<head>

<title>List Directorate</title>
<meta name="description" content="">
<meta name="author" content="">

<!-- Combined stylesheets load -->
<!-- Load either 960.gs.fluid or 960.gs to toggle between fixed and fluid layout -->
<link href="css/main.css" rel="stylesheet" type="text/css">

<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/png" href="favicon-large.png">
<script src="js/index.js"></script>
<script src="js/jquery.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/jstab.js"></script>


</head>

<body>

	<!-- Content -->
	<article class="container_12">

		<section class="grid_8">
			<div class="block-border">
				<form class="block-content form" id="table_form" method="get"
					action="listDirectorate">
					<h1>BU/Directorates</h1>
					<div class="block-controls">
						<div class="float-right">
							<a class="button red" title="Add" href="addDirectorate.jsp">
								<span class="smaller">CREATE</span> </a> <input id = "chkboxInclude" type="checkbox" name="checkInclude" value="true"
                                           ${ checkInclude ? "checked" : "" }
                                           onclick="document.getElementById('table_form').submit();" />
                                    <label for="table-display" style="display: inline">Include
                                        In-active</label>

						</div>

						<ul class="controls-buttons" style="cursor: pointer">
							<s:hidden type="hidden" id="filter" name="filter" />
							<s:hidden type="hidden" id="checkActive" name="checkActive" />
							<li><a
								onclick="document.getElementById('filter').value = 'all'; document.getElementById('table_form').submit();">
									<strong>ALL</strong> </a></li>
							<li class="sep"></li>
							<li><a
								onclick="document.getElementById('filter').value = '0-9'; document.getElementById('table_form').submit();">
									<strong>0-9</strong> </a></li>
							<li><a
								onclick="document.getElementById('filter').value = 'ABCDE'; document.getElementById('table_form').submit();">
									<strong>A B C D E</strong> </a></li>
							<li><a
								onclick="document.getElementById('filter').value = 'FGHIJ'; document.getElementById('table_form').submit();">
									<strong>F G H I J</strong> </a></li>

							<li><a
								onclick="document.getElementById('filter').value = 'KLMN'; document.getElementById('table_form').submit();">
									<strong>K L M N </strong> </a></li>

							<li><a
								onclick="document.getElementById('filter').value = 'OPQR'; document.getElementById('table_form').submit();">
									<strong>O P Q R </strong> </a></li>

							<li><a
								onclick="document.getElementById('filter').value = 'STUV'; document.getElementById('table_form').submit();">
									<strong>S T U V </strong> </a></li>

							<li><a
								onclick="document.getElementById('filter').value = 'WXYZ'; document.getElementById('table_form').submit();">
									<strong>W X Y Z </strong> </a></li>

						</ul>


					</div>

					<div class="no-margin">

						<div class="no-margin">
							<table class="table" id="tablepaging" cellspacing="0"
								width="100%">
								<thead>
									<tr>

										<th scope="col">BU/DirectorateName</th>
										<th scope="col">Office Address Line 1</th>
										<th scope="col">Postcode</th>
										<th scope="col">Contact</th>
										<th scope="col">IsActive?</th>
									</tr>
								</thead>
								<s:iterator value="directorateList" var="item">
									<tr>

										<td><a href="javascript:editr(${item.directorateID })">${item.directorateName }</a>
										</td>
										<td>${item.addr1 }</td>
										<td>${item.postcode }</td>
										<td>${item.contactName }</td>
										<td>${item.isActive ==1?"Yes":"No"}</td>
									</tr>
								</s:iterator>
							</table>
						</div>

					</div>


					<div class="block-footer" id="pageNavPosition">
						<script type="text/javascript">
							var pager = new Pager('tablepaging', 5);
							pager.init();
							pager.showPageNav('pager', 'pageNavPosition');
							pager.showPage(1);
						</script>
					</div>

				</form>
			</div>
		</section>




		<div class="clear"></div>

	</article>

	<!-- End content -->

	<footer> </footer>
	<script>
		function editr(val) {
			window.location.href = 'addDirectorate.jsp?directorateID=1';
		}
		function delete1(val) {
			window.location.href = 'delete?programmeID=' + val;
		}
		function addData(val) {
			if (val == true) {
				document.getElementById("data 10").innerHTML = "<td>Directorate 10</td>"
						+ "<td>Address 10</td>"
						+ "<td>SE 10</td>"
						+ "<td>Fresher</td>" + "<td>No</td>" + "<td></td>";
				+"<td class=\"table-actions\"><a href=\"javascript:editr(1)"
						+ "title=\"Edit\" class=\"with-tip\"><img"
						+"src=\"images/icons/fugue/pencil.png\" width=\"16\" height=\"16\">"
						+ "</a> <a href=\"javascript:delete1(<s:property value=""/>)"
						+ "title=\"Delete\" class=\"with-tip\"><img"
						+"src=\"images/icons/fugue/cross-circle.png\" width=\"16\""
						+"height=\"16\"> </a></td>";
			} else {
				document.getElementById("data 10").innerHTML = "";
			}
		}
		function editr(val) {
			window.location.href = 'fetch?directorateID=' + val;
		}
		function doAction(action) { 
			window.location = action;
		}
	</script>

</body>
</html>